package cn.jdy.plugins.web;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import cn.jdy.common.ctrl.BaseCtrl;
import cn.jdy.platform.entity.ConfValue;
import cn.jdy.platform.service.ConfService;

/**
 * 品牌评论操作类(品牌评论暂时只允许评论，不允许回复)
 *
 * @author GXP
 */
@Controller
@RequestMapping("/brand")
public class BrandCtrl extends BaseCtrl {

	@Autowired
	private ConfService confService;
	
	/**
	 * 
	 * @param typeid 配置项分类编码
	 * @param pid 父id
	 * @return
	 */
	@RequestMapping(value = "/search")
	public ModelAndView search(Long typeid,Long pid,String childrenIds) {
		ModelAndView mv = new ModelAndView("/company/searchlist.jsp");
		// 查询商机分类信息
		List<ConfValue> brandList = confService.queryConfValueByPid(typeid==null?null:typeid.intValue(),pid, childrenIds,"2");
		mv.addObject("brandList", brandList);
		
		mv.addObject("typeid", typeid);
		mv.addObject("pid", pid);
		mv.addObject("childrenIds", childrenIds);
		return mv;
	}
	
}
